<template>
  <a-table :columns="columns" :data-source="data">
           

          <span slot="typeCode" slot-scope="text,record" >
               <a-select placeholder="请选择"
                      style="width:80%"
                      v-model="record.typeCode"
                      @change="devicPeyixieFm"
                    >
                      <a-select-option
                              v-for="(item, index) in modelaChoseData"
                              :key="index"
                              :value="item.typeCode"
                            >
                              {{ item.typeName }}
                      </a-select-option>
              </a-select>
          </span>



  </a-table>
</template>
<script>
const columns = [
  {
    title: 'Name',
    dataIndex: 'name',
    // key: 'name',
    scopedSlots: { customRender: 'name' },
  },
  {
    title: 'Age',
    dataIndex: 'age',
    // key: 'age',
    
  },
  {
    title: 'Address',
    dataIndex: 'address',
    // key: 'address 1',
    ellipsis: true,
  },
  {
    title: '支持与否',
    dataIndex: 'typeCode',
    // key: 'typeCode',
    scopedSlots: { customRender: 'typeCode' },
    
    
  },
];



export default {
  data() {
    return {
      data : [
          {
            key: '1',
            name: 'John Brown',
            age: 32,
            address: 'aaaaa',
            typeCode:'支持',
            // tags: ['nice', 'developer'],
          },
          {
            key: '2',
            name: 'Jim Green',
            age: 42,
            address: 'bbbbb',
            typeCode:'不支持',
            // tags: ['loser'],
          },
          {
            key: '3',
            name: 'Joe Black',
            age: 32,
            address: 'ccccc',
            typeCode:'支持',
            // tags: ['cool', 'teacher'],
          },
        ],
      columns,
      modelaChoseData:[
          {
             typeCode:"0",
             typeName:"支持",
          },
           {
             typeCode:"1",
             typeName:"不支持",
          }

      ]
    };
  },
  methods:{
    devicPeyixieFm(){
       console.log(this.data)
    }
  }
};
</script>